import backtrader as bt

class BaoStockPandasData(bt.feeds.PandasData):
    params = (
        ('datetime', 0),      # DataFrame中的日期列索引
        ('open', 1),          # 开盘价列索引
        ('high', 2),          # 最高价列索引
        ('low', 3),           # 最低价列索引
        ('close', 4),         # 收盘价列索引
        ('volume', 5),        # 成交量列索引
        ('openinterest', -1), # 可选，如果没有则设为-1
    )